public class DynamicPolymorphism {

    public static void main(String[] args) {
        SubClass s1 = new SubClass();
        s1.m1(); //
        s1.m2(); //
    }
}

class SuperClass {

    void m1() {
        System.out.println("m1 method in SuperClass.");
    }
    void m2() {
        System.out.println("m2 method in SuperClass.");
    }
}

class SubClass extends SuperClass {

    void m1() {
        System.out.println("m1 method in SubClass.");
        super.m1(); // super();
    }

    // Ctrl + o


    @Override
    void m2() {
//        super.m2();
    }
}
